package com.allwees.bs.module.scm.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.allwees.bs.core.model.order.entity.ErpBaseOrderSku;
import com.allwees.core.common.util.MoneyUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import java.math.BigDecimal;

/**
 *
 * 拣货单明细
 * @see ScmPickOrderSku
 * @author
 * @since
 */
@Accessors(chain = true)
@Data
@TableName("scm_shipping_order_sku")
public class ScmShippingOrderSku extends ErpBaseOrderSku {

    @Column(length = 48, updatable = false)
    private String shippingOrderUuid;

    /** pick order sku uuid **/
    @Column(length = 48, updatable = false)
    private String pickOrderSkuUuid;

    /** 发货数量 **/
    @Column(updatable = false)
    private Integer shippingQuantity;

    /** 退货原因 **/
    private String refundReason;

    /** 退货人 **/
    private String refundUserUuid;

    /** 退货人 **/
    private String refundUserName;

    /** 入仓人 **/
    private String enteredWarehouseUserUuid;

    /** 入仓人 **/
    private String enteredWarehouseUserName;

    /** 货架uuid **/
    private String shelfUuid;

    /** 货位uuid **/
    private String slotUuid;

    public BigDecimal getShippedAmt(){
        return MoneyUtil.mul(supplyPrice, shippingQuantity);
    }
}
